<?
include_once("_common.php");
include_once("$mw_cash[path]/cybercash.lib.php");

if (!$is_member)
    alert_close("로그인 후 이용해주세요.");

if (!$mw_cash[cf_cash_to_point])
    alert_close("$mw_cash[cf_cash_name] 전환기능이 활성화되어 있지 않습니다.");

if ($mw_cash['cf_cash_to_point_level'] && $mw_cash['cf_cash_to_point_level'] > $member['mb_level'])
    alert_close("회원권한 {$mw_cash['cf_cash_to_point_level']}레벨 이상 변환 가능합니다.");

//$point = mw_get_point_to_cash_possible();
$cash = floor($point / $mw_cash[cf_cash_point]);

//if ($point < $mw_cash[cf_point_min]) alert_close(number_format($mw_cash[cf_point_min])." 포인트 이상되야 $mw_cash[cf_cash_name] 전환이 가능합니다.");

$g4[title] = "$mw_cash[cf_cash_name]→포인트 전환";
include_once("$g4[path]/head.sub.php");
?>

<style type="text/css">
body { padding:10px; }
h3 { font-size:15px; }
.point-info { border:5px solid #efefef; padding:20px; font-weight:bold; text-align:center; font-size:13px; }
td.head { border-bottom:1px solid #ddd; padding:15px 10px 0 0; font-weight:bold; }
td.body { border-bottom:1px solid #ddd; padding:10px; }
.btn1 { background-color:#efefef; cursor:pointer; }
.hints { color:#888; margin:5px 0 5px 0; }
.blue { color:#0D6AB2; }
.button { text-align:center; margin:30px 0 30px 0; }
#payment-info { color:#888; }
</style>

<script type="text/javascript">
function form_submit() {
    if (confirm('정말 전환하시겠습니까?'))
	return true;
    else
	return false;
}
</script>

<h3><?=$mw_cash[cf_cash_name]?>→포인트 전환</h3>

<form name="fwrite" method="post" action="cash-to-point-update.php" onsubmit="return form_submit()">
<div class="point-info">
    <?=$mw_cash[cf_cash_name]?> <span class="blue"><?=number_format($mw_cash[mb_cash])?><?=$mw_cash[cf_cash_unit]?></span> 중
    <input type="text" size="10" name="cash_to_point" required numeric itemname="<?=$mw_cash[cf_cash_name]?>" value="" class="ed" onkeydown="if (event.keyCode==13) return false;" onkeyup="how_much_cash_charge()"><?=$mw_cash[cf_cash_unit]?> 포인트로 전환
    <? /* ?>
    <select name="point_to_cash" required itemname="<?=$mw_cash[cf_cash_name]?>">
    <? for ($i=1; $i<=$cash; $i++) { ?>
    <option value="<?=$i?>"> <?=$mw_cash[cf_cash_name]?> <?=$i?> <?=$mw_cash[cf_cash_unit]?></option>
    <? } ?>
    </select> 
    <? */?>
</div>

<div class="button">
<input type="submit" value="확    인" class="btn1">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" value="취    소" class="btn1" onclick="self.close()">
</div>
</form>

<div class="hints">※ <?="$mw_cash[cf_cash_name] 1$mw_cash[cf_cash_unit] 당 포인트 ".number_format($mw_cash[cf_cash_point])." 점"?></div>

<?
include_once("$g4[path]/tail.sub.php");
?>
